package com.kerrykidz.system.util.sync;

import java.util.ArrayList;
import java.util.List;

public class SyncUtil {

	public static <E> List<List<E>> breakUpList(List<E> list, int len) {
		List<List<E>> result = new ArrayList<List<E>>();
		int a = 0;
		int b = len;
		while (true) {
			boolean bo = list.size() <= b;
			if (bo) {
				b = list.size();
			}
			List<E> temList = list.subList(a, b);
			result.add(temList);
			if (bo)
				break;
			a += len;
			b += len;
		}
		return result;
	}
}
